Skip to content

Added support for Unity 2019.4 - 2021.2 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

neon-age
Copy link

Fork with updated version: https://github.com/neon-age/shader-graph-nodes

Issue

This asset still uses CodeFunctionNode API, which was made internal in 2018.2.,
Instead of it, Unity forces us to manually update ALL our nodes to sub-graphs, which is super clumsy and is not as robust.
We can't do any custom UI or methods selection using it.

Solution

Instead of rewriting every node to sub-graphs, we'll just access forbidden API again, by using AsmRef:
https://docs.unity.cn/2019.4/Documentation/Manual/class-AssemblyDefinitionReferenceImporter.html

Which only required:

  • Unity 2019.4 or higher.
  • Adding AsmReference to main folder with definition to Unity.ShaderGraph.Editor.
    This will include and compile all our custom nodes inside ShaderGraph assembly, giving us access to internal API's.
  • Changing node classes to be internal to avoid accessibility compile errors.

The CodeFunctionNode API hasn't changed a bit since Unity 2018.2 and works in newer versions up to 2021.2!

neon-age added 3 commits May 15, 2021 16:09
- AsmReference with definition to Unity.ShaderGraph.Editor
- Change node classes from public to internal
@daangijzen
Copy link

This also works in 23.3.0b8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants